Welcome to the SmartImage 'ReadMe' file

Introduction

SmartImage is a suite of JavaScript scripts that allow for scanning for the Shockwave plugin. Without these scripts, users without the Shockwave plugin would get broken icons in place of the animations. Now with the SmartImage scripts, the user will get an alternate image in place of the animation. The following table describes what different users will see.

User With SmartImage Without SmartImage
Mosaic Alternate static images Alternate static images
Netscape 1.x Alternate static images Alternate Static Images
Netscape 2.x with Shockwave Animations Animations
Netscape 2.x without Shockwave Alternate images + 1 broken icon Broken icons in place of images
Netscape 3.x with Shockwave Animations Animations
Netscape 3.x without Shockwave Alternate images Broken icons in place of images

This script fixes the case in which the user has Netscape 2.x and doesn't have the Shockwave plugin. Previously there has been no solution for this. It also works very well for Netscape 3.x (Atlas).

In addition, SmartImage allows the user to shut of the animations if he so desires.


Known Bugs

This script is not perfect. The most difficult case is the one in which the user has Netscape 2.x and doesn't have Shockwave. The user will see a broken icon in the upper left corner of the page the first time he enters. Also, a dialog box will come up the first time telling the user that he needs to get the Shockwave plugin. There is no way to get around this. Don't ask.

One thing to note about the dialog box - It gives you two choices, "cancel" and "Plug-in Info". Either selection will work for the client. If he picks cancel, he'll see the page without the animations. If he picks plugin-info, he'll be able to download the plugin.


Cost

The SmartImage script is shareware. You can download SmartImage from Banshee Productions or send us email at banshee@midtown.net.

The cost is $40 for commercial pages, and $10 for personal pages. A commercial page is one that is used to advertise any sort of business or one that someone got paid to create.

If you don't think you can add the scripts to your page yourself, I can do it for you for about $150. Send me email to banshee@midtown.net.


Instructions

  1. Download the script. You can get it from Banshee Productions and some other shareware archives.

  2. If your browser doesn't decompress the files for you, do it now. Use pkunzip for Windows or StuffIt Expander for Macintosh.

  3. Open the "function.html" file with your favorite html editor. This file contains all the scripts you need for SmartImage.

  4. Open your own "index.htm" file. It's important that your main page is named "index.htm", not "index.html". If you wish to use another name for your main page, you'll have to edit and re-burn the goto.dir director movie (see below).

  5. Cut the 'Cookie State and SmartImage' section of the script from the functions.html section of the script.

  6. Paste this into the HEAD section of your html document. (Not in the HEAD tag. Between the <HEAD> and </HEAD> tags.)

  7. Cut the 'Probe Plugin' section of the script from the functions.html file.

  8. Paste this at the begining of the body of your index.htm file.

  9. Cut the 'SmartImage call' section of the script from the functions.html file.

  10. Paste this section of code everywhere you want an animation in your index.htm file.

  11. Edit this section of code to the values you want. An example is:

    <SCRIPT>
    <!-- hide from other browsers

    smart_image('shock/logo.dcr',100,100,"",'images/logo.gif',110,110,"",'Logo Image');

    // done hiding --> <IMG SRC="images/logo.gif" ALT="Logo Image" WIDTH=110 HEIGHT=110>
    </SCRIPT>

    This would put the animation "logo.dcr" from the "shock" directory on the page if the user has Shockwave. Otherwise, the user would get the image "logo.gif" from the "images" directory. The "Logo Image" is the alternate text the client would get if he has the images off. Those two pairs of double quotes are for other optional things to put in the IMAGE or EMBED tags. Don't forget them!

  12. For every other page at your site where you want an animation, just paste the SmartImage script into the head of the document and the SmartImage call section where you want the animation.

  13. Put the goto.dcr file in the same directory as your index.htm

  14. Check out your page with and without the Shockwave plugin (remember to restart Netscape and click on "Rescan for Shockwave" every time you take out or put in the plugin).

  15. Put the following line at the bottom of your page:

    Shockwave scanning made possible by <A HREF="http://www.midtown.net/~banshee>Banshee Productions</A>
  16. Send a check for $40 or $10 (whichever the case may be) to
    Jon Stephan
    PO Box 1505
    Folsom, CA 95763
This page is a good example of an index.htm that uses all the SmartImage scripts. And here's an example of a second page that only uses the SmartImage and the SmartImage call scripts.


Suggestions and Gotcha's

Make sure you have the right number of parameters passed into the SmartImage function. The exact synatax is:
smart_image (movie,mw,mh,mother,still,sw,sh,alttxt,sother)
Where:

Make sure that the goto.dcr file is in the same directory as your index.htm file. Shockwave's relative refrences are relative to the movie, not relative to the HTML document, so this file has to be in the same place as the index.htm file, not in a subdirectory under it.

If you want to change the name of your main page from index.htm to something else, you have to go in to the goto.dir director movie and change the Lingo script in the first frame to reflect your URL. Make sure to run the file through Afterburner again to convert it to goto.dcr.

Make sure that each time you install or uninstall your Shockwave plugin that you restart Netscape, then click on "Rescan for Shockwave".


How it works

SmartImage works by using a small Shockwave movie to re-load the page, but with a search flag ('?s') tacked to the end of the URL. The script then detects this ?s and substitutes the animations into the page. If the ?s is not present, the Shockwave movie was not able to play, so the client is assumed to not have Shockwave, and the alternate images are substituted.

This re-loading of the page can be a bit distracting, so a document cookie has been added to let the script know that the client has Shockwave next time he visits the page. When the client enters the page, the script checks the cookie first to see if the client has Shockwave.

The cookie also allows other pages on your site to use the same cookie, so that every page doesn't need to scan for the plugin.


Feedback

If you have questions or comments, respond to banshee@midtown.net. The only exceptions are:

- The question "How do I get rid of that broken icon at the top of the page when I don't have Shockwave?" or "How do I keep that dialog box from comming up?". You can't. These bugs are inherent in this method. SmartImage is the best known solution, you'd have a lot more broken icons and a lot more dialog boxes without it.

- The statement "I hate your script, you still get that broken icon at the top of the page and a dialog box sometimes". I know about these problems. If you don't like the script, don't use it.
Shockwave plugin scanning made possible by Banshee Productions
Back to the Banshee home page